home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / Xm / XmQTtakesDefault.z / XmQTtakesDefault
Text File  |  1998-10-30  |  10KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXmmmmQQQQTTTTttttaaaakkkkeeeessssDDDDeeeeffffaaaauuuulllltttt((((3333XXXX))))      UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV      XXXXmmmmQQQQTTTTttttaaaakkkkeeeessssDDDDeeeeffffaaaauuuulllltttt((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           _X_m_Q_T_t_a_k_e_s_D_e_f_a_u_l_t - A button widget holding this trait can
  10.           change its appearance to show that it is the default button
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           #include <Xm/TakesDefT.h>
  14.  
  15.           typedef struct {
  16.                     int                             version;
  17.                     XmTakesDefaultNotifyProc        showAsDefault;
  18.           } XmTakesDefaultTraitRec, *XmTakesDefaultTrait;
  19.           vvvvooooiiiidddd ((((****XXXXmmmmTTTTaaaakkkkeeeessssDDDDeeeeffffaaaauuuullllttttNNNNoooottttiiiiffffyyyyPPPPrrrroooocccc))))(
  20.           WWWWiiiiddddggggeeeetttt,
  21.           XXXXttttEEEEnnnnuuuummmm);
  22.  
  23.      VVVVEEEERRRRSSSSIIIIOOOONNNN
  24.           This page documents Motif 2.1.
  25.  
  26.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.           You will use the _X_m_Q_T_t_a_k_e_s_D_e_f_a_u_l_t trait if you are writing a
  28.           PushButton-style primitive widget or a DialogBox-style
  29.           manager widget.
  30.  
  31.           A DialogBox widget displays several PushButton-style
  32.           children.  For example, a typical DialogBox widget might
  33.           display three PushButton widgets: an OK button, a Cancel
  34.           button, and a Help button.  One of these PushButton-style
  35.           children should be the default button.  The default button
  36.           is the PushButton-style child that is activated when the
  37.           user presses <<<<RRRReeeettttuuuurrrrnnnn>>>> anywhere in the widget.  (The
  38.           ppppaaaarrrreeeennnntttt____pppprrrroooocccceeeessssssss method of the DialogBox is responsible for
  39.           detecting the activation event.)
  40.  
  41.           A PushButton-style widget must be capable of altering its
  42.           appearance to show that it is the default choice.  Most
  43.           PushButton-style widgets do this by highlighting their
  44.           borders in a special way.
  45.  
  46.           If you are writing a PushButton-style widget, then your
  47.           widget should hold the _X_m_Q_T_t_a_k_e_s_D_e_f_a_u_l_t trait. This trait
  48.           announces to DialogBox widgets that the child is capable of
  49.           changing its appearance to show that it is the default
  50.           choice.  Conversely, if you are writing a DialogBox widget,
  51.           then your DialogBox widget should examine its button
  52.           children for this trait.
  53.  
  54.           The following standard Motif primitives hold this trait:
  55.  
  56.              +o  XXXXmmmmPPPPuuuusssshhhhBBBBuuuuttttttttoooonnnn
  57.  
  58.              +o  XXXXmmmmPPPPuuuusssshhhhBBBBuuuuttttttttoooonnnnGGGGaaaaddddggggeeeetttt
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/24/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXmmmmQQQQTTTTttttaaaakkkkeeeessssDDDDeeeeffffaaaauuuulllltttt((((3333XXXX))))      UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV      XXXXmmmmQQQQTTTTttttaaaakkkkeeeessssDDDDeeeeffffaaaauuuulllltttt((((3333XXXX))))
  71.  
  72.  
  73.  
  74.           In addition, the EEEExxxxmmmmCCCCoooommmmmmmmaaaannnnddddBBBBuuuuttttttttoooonnnn demonstrates how to
  75.           install this trait and how to define a sssshhhhoooowwwwAAAAssssDDDDeeeeffffaaaauuuulllltttt trait
  76.           method.
  77.  
  78.           The following standard Motif managers examine their children
  79.           widgets for this trait and call the sssshhhhoooowwwwAAAAssssDDDDeeeeffffaaaauuuulllltttt trait
  80.           method:
  81.  
  82.              +o  XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd and all its subclasses
  83.  
  84.         TTTThhhheeee sssshhhhoooowwwwAAAAssssDDDDeeeeffffaaaauuuulllltttt TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd
  85.           vvvvooooiiiidddd sssshhhhoooowwwwAAAAssssDDDDeeeeffffaaaauuuulllltttt(
  86.           WWWWiiiiddddggggeeeetttt cccchhhhiiiillllddddWWWWiiiiddddggggeeeetttt,
  87.           XXXXttttEEEEnnnnuuuummmm ssssttttaaaatttteeee);
  88.  
  89.           Every PushButton-style widget holding the _X_m_Q_T_t_a_k_e_s_D_e_f_a_u_l_t
  90.           trait must provide a sssshhhhoooowwwwAAAAssssDDDDeeeeffffaaaauuuulllltttt trait method.  The
  91.           DialogBox that manages the PushButton-style widgets will
  92.           call the _X_m_Q_T_t_a_k_e_s_D_e_f_a_u_l_t trait method, each time passing a
  93.           different value of _s_t_a_t_e. The typical sequence of calls from
  94.           the DialogBox manager is as follows:
  95.  
  96.              +o  The DialogBox calls the sssshhhhoooowwwwAAAAssssDDDDeeeeffffaaaauuuulllltttt trait method of
  97.                 each child widget, specifying a _s_t_a_t_e of
  98.                 XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____RRRREEEEAAAADDDDYYYY.  This message tells the child to
  99.                 prepare to become the default button.  The _M_o_t_i_f _S_t_y_l_e
  100.                 _G_u_i_d_edoes not mandate a particular way of handling
  101.                 this message, so your widget may visually do as you
  102.                 please. One possible response would be to increase the
  103.                 widget's internal margins.  (Calling XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____RRRREEEEAAAADDDDYYYY
  104.                 helps the manager avoid future unnecessary geometry
  105.                 requests.)
  106.  
  107.              +o  The DialogBox calls the sssshhhhoooowwwwAAAAssssDDDDeeeeffffaaaauuuulllltttt trait method of
  108.                 the chosen default child, specifying a _s_t_a_t_e of
  109.                 XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____OOOONNNN.  This message tells the child to become
  110.                 the default button.  The child must change its visual
  111.                 appearance in some way to show the user that it is now
  112.                 the default button. For example, the _E_x_m_C_o_m_m_a_n_d_B_u_t_t_o_n
  113.                 demonstration widget increases its shadow thickness to
  114.                 show that it is the default. Another widget might
  115.                 display some sort of icon (perhaps an arrow) to
  116.                 symbolize that it is the default button.
  117.  
  118.              +o  If the default child widget changes, then the
  119.                 DialogBox calls the sssshhhhoooowwwwAAAAssssDDDDeeeeffffaaaauuuulllltttt trait method twice.
  120.                 The first call specifies a _s_t_a_t_e of XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____OOOOFFFFFFFF in
  121.                 order to turn off one default button. The second call
  122.                 specifies a _s_t_a_t_e of XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____OOOONNNN in order to turn on
  123.                 the new default button.  Upon receiving the
  124.                 XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____OOOOFFFFFFFF message, the child widget must change
  125.                 its appearance to show that it is no longer the
  126.  
  127.  
  128.  
  129.      Page 2                                         (printed 10/24/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXmmmmQQQQTTTTttttaaaakkkkeeeessssDDDDeeeeffffaaaauuuulllltttt((((3333XXXX))))      UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV      XXXXmmmmQQQQTTTTttttaaaakkkkeeeessssDDDDeeeeffffaaaauuuulllltttt((((3333XXXX))))
  137.  
  138.  
  139.  
  140.                 default.
  141.  
  142.           XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____FFFFOOOORRRRGGGGEEEETTTT resets the visual appearance of a child
  143.           widget so that it looks as it did prior to the
  144.           XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____RRRREEEEAAAADDDDYYYYcall.
  145.  
  146.           _c_h_i_l_d_W_i_d_g_e_t
  147.                     Specifies the child widget holding this trait.
  148.  
  149.           _s_t_a_t_e     Specifies one of the following states:
  150.                     XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____RRRREEEEAAAADDDDYYYY, XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____OOOONNNN, XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____OOOOFFFFFFFF, and
  151.                     XXXXmmmmDDDDEEEEFFFFAAAAUUUULLLLTTTT____FFFFOOOORRRRGGGGEEEETTTT.
  152.  
  153.      RRRREEEELLLLAAAATTTTEEEEDDDD
  154.           XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd(3), XXXXmmmmPPPPuuuusssshhhhBBBBuuuuttttttttoooonnnn(3), and
  155.           EEEExxxxmmmmCCCCoooommmmmmmmaaaannnnddddBBBBuuuuttttttttoooonnnn(3).
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                         (printed 10/24/98)
  196.  
  197.  
  198.  
  199.